package com.example.boot_easy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.boot_easy.mapper.AccountMapper;
import com.example.boot_easy.pojo.Account;
import com.example.boot_easy.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public
class AccountServiceImpl implements AccountService {
    @Resource
    private AccountMapper accountMapper;

    @Override
    public void addAccount(Account account) {
//        accountMapper.insertAccount(account);
        accountMapper.insert(account);
    }

   public void deleteById(Integer id){
       accountMapper.deleteById(id);
   }
    public void updateById(Account account){
        accountMapper.updateById(account);
    }
    public List<Account> query(){
//     return accountMapper.query();
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("sex","女");
        return accountMapper.selectList(queryWrapper);
    }


}
